# @Time    : 2024/12/31 14:42
# @Author  : Zhang Yihao
import os

def use_rename():
    os.rename('dir1/file4','dir1/file1')
    os.remove('dir1/file1')

def use_dir_func():
    file_list=os.listdir()
    print(file_list)
    os.mkdir('dir2')
    os.rmdir('dir1')
    print(os.getcwd())
    os.chdir('dir2')
    file=open('file1','w',encoding='utf-8')
    file.close()

if __name__ == '__main__':
    # use_rename()
    use_dir_func()